﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameViewer.Core;
using GameViewer.Core.Viewers;

namespace Plugin_Ogre
{
    public class PluginEntry : GameViewer.Core.Plugins.IPlugin
    {
        private bool mActive = false;

        #region IPlugin 成员

        public string PluginName
        {
            get { return "WoW"; }
        }

        public bool Active
        {
            get
            {
                return mActive;
            }
            set
            {
                if (mActive == value)
                {
                    return;
                }
                mActive = value;
                if (value)
                {
                    this.Init();
                }
            }
        }

        public void Configure()
        {
            //throw new NotImplementedException();
        }

        #endregion

        private void Init()
        {
            LogManager.Instance.LogMessage("Installing plugin: Ogre.");
            ViewerManager.Instance.AddViewer("mesh", typeof(OgreMeshViewer));
            ViewerManager.Instance.AddViewer("material", typeof(TextViewer));
            ViewerManager.Instance.AddViewer("cg", typeof(TextViewer));
            ViewerManager.Instance.AddViewer("hlsl", typeof(TextViewer));
            ViewerManager.Instance.AddViewer("glsl", typeof(TextViewer));
            ViewerManager.Instance.AddViewer("program", typeof(TextViewer));
            ViewerManager.Instance.AddViewer("compositor", typeof(TextViewer));
            ViewerManager.Instance.AddViewer("overlay", typeof(TextViewer));
            ViewerManager.Instance.AddViewer("asm", typeof(TextViewer));
            ViewerManager.Instance.AddViewer("controls", typeof(TextViewer));
        }
    }
}
